﻿using LeRenard.Libraries.PlatformInspection.InfoNodes;
using System;
using System.Collections.Generic;
using System.Linq;

namespace LeRenard.Libraries.PlatformInspection.Inspectors.Environment
{
    public class OperatingSystemEnvironmentInspectorModule : InspectorModule<EnvironmentInspector>
    {
        /// <summary>
        /// Constructions
        /// </summary>
        public OperatingSystemEnvironmentInspectorModule() 
            : base("Operating System") 
        { 
        }

        /// <summary>
        /// Gets the information this module gathers.
        /// </summary>        
        protected override IEnumerable<InfoNode> GetInformationImpl()
        {
            var infoNodes = new List<InfoNode>();            

            infoNodes.Add(new InfoNode("Full Version String", System.Environment.OSVersion.VersionString.ToString()));
            infoNodes.Add(new InfoNode("Platform Id", System.Environment.OSVersion.Platform.ToString()));
            infoNodes.Add(new InfoNode("Version", System.Environment.OSVersion.Version.ToString()));
            infoNodes.Add(new InfoNode("Service Pack", System.Environment.OSVersion.ServicePack.ToString()));            

            return infoNodes.OrderBy(inf => inf.Name);
        }
    }
}
